import sympy as sym
import numpy as np
from sympy import sin,cos,Function
sym.init_printing()
#document:https://github.com/sympy/sympy


def power(arg_a, arg_b, flag = True):
    if flag:
        return sym.simplify(np.power(arg_a, arg_b))
    else :
        return np.power(arg_a, arg_b)
    
x = sym.symbols('x')
y = sym.symbols('y')
A = [[x,sin(x),11/6], [y,sin(y),11/6]]
B = [[x, x, x],[y, x**2, x]]
f, g = sym.symbols('f,g', cls=Function)
f = x**2+ 3*x + 2
g = 3*x - 1

res = power(x, y)
res1 = power(2, A)
res2 = power(B, x)
res3 = power(f, g)
res4 = power(A, B)
res5 = power(f, x)
print(res)
print(res1)
print(res2)
print(res3)
print(res4)
print(res5)
print(A)



